﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using RPGSoundmixerGUI.Forms.Interface;
using RPGSoundmixerGUI.Controller;
using RPGSoundmixerGUI.Forms.Dialogs;


namespace RPGSoundmixerGUI.Forms {
    public partial class MainForm : Form, IMainForm {
        
        public MainForm() {
            InitializeComponent();
            new MainController(this);
        }  

        private void tabPage1_Click(object sender, EventArgs e) {

        }

        /// <summary>
        /// Mit dieser Methode kann man ein TabView zu dem GUI hinzufügen
        /// </summary>
        /// <param name="tab"></param>
        void IMainForm.ShowTabInFront(TabView tab) {
            throw new NotImplementedException();
        }


        /// <summary>
        /// Event, welcher gefeuert wird, wenn die Datenbank Angaben geändert wurden.
        /// </summary>
        public event Events.PropertyChangedHandler OnDatabaseParameterChanged;

        /// <summary>
        /// Menu Handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e) {
            if (e.ClickedItem.Name.Equals("OptionsMenuItem")) {
                OptionsForm oForm = new OptionsForm();
                oForm.ShowDialog();
                this.OnDatabaseParameterChanged(this, 
                    new Events.PropertyChangedEventArgs(null, 0, oForm.dbPath));
            }
        }

        /// <summary>
        /// Event, welcher gefeuert wird, wenn ein TreeView Item ausgewählt wurde. 
        /// </summary>
        public event Events.TreeItemSelectedHandler OnTreeItemSelected;


        public void AddTab(TabView tab) {
            throw new NotImplementedException();
        }
    }
}
